/** @Author: maybe  
* @Date: 2019-06-10 15:02:45  
*/

import ajax from './ajax'
// 1. 基础路径
 const BASE_URL = '';
/** 
* 用户模块  
*/ 
// 1.0 用户名和密码登录   param={ phoneNum:string,  password:string }
export const  pwdLogin = (param) => ajax(BASE_URL + '/api/login/byPassword.do', param, 'POST');
// 1.1 用户名和短信验证码登录
export const  mobLogin = (param) => ajax(BASE_URL + '/api/login/byVerifyCode.do', param, 'POST');
// 1.2 获取盐        state 登录：1     注册和忘记密码:2
export const  getSalt = (param) => ajax(BASE_URL + '/api/salt/getSalt.do',param, 'POST')
// 1.3 忘记密码
export const  forgetPwd = (param) => ajax(BASE_URL + '/api/customer/forgetPassword.do',param, 'POST')
// 1.5  用户注册    param={phoneNum:string,password:string}
export const  register = (param) => ajax(BASE_URL + '/api/customer/register.do', param, 'POST')
// 1.6 退出登录   param = { customerId }
export const loginOut = (param) => ajax(BASE_URL + '/api/customer/logout')
// 1.7 获取验证码 登录
export const getVerifyCode = (param) => ajax(BASE_URL + '/api/login/getVerifyCode.do',param, 'POST')

/**
 * @description: 个人账户模块 
 */
// 2.0查询个人信息
export const getAuthInfo = (param) => ajax(BASE_URL + '/api/customer/getAuthInfo.do',param, 'POST')
// 2.1 个人账户信息
export const getAccount = (param) => ajax(BASE_URL + '/api/account/getAccount',param, 'POST')
// 2.2 实名认证
export const getRealAuth = (param) => ajax(BASE_URL + '/api/customer/realAuth.do',param, 'POST')
// 2.3 查询银行卡接口
export const getBankCard = (param) => ajax(BASE_URL + '/api/customer/getBankCardList',param, 'POST')
// 2.4 绑卡接口
export const addBank = (param) => ajax(BASE_URL + '/api/customer/bindBankCard.do',param,'POST')
// 2.5 解绑银行卡接口  params = {bankcard}
export const unbindBankCard = (param) => ajax(BASE_URL + '/api/customer/unbindBankCard.do',param,'POST')
// 2.6 历史订单记录  (历史所有的订单) 个人中心所有订单列表
export const getAllHistoryOrder = (param) => ajax(BASE_URL+'/api/order/getAllHistoryOrder.do',param,'POST')
// 2.7 出金记录
export const getWithdraw = (param) => ajax(BASE_URL + '/api/record/withdraw.do',param,'POST')
// 2.8 入金记录
export const getRecharge = (param) => ajax(BASE_URL + '/api/record/recharge.do',param,'POST')
// 2.9 提现
export const doWithdraw = (param) => ajax(BASE_URL + '/exchange/pay/apply/withdrawal.do',param,'POST')
// 2.10 充值
export const doRecharge = (param) => ajax(BASE_URL + '/exchange/pay/order.do',param,'POST')


/**
 * @description: 交易
 */
// 3.0查询交易对
export const getTradeList = (param) => ajax(BASE_URL + '/tradeapi/getTrade/getBol.do',param,'POST')
// 3.1查询K线数据 1
export const getKLine = (param) => ajax(BASE_URL + '/tradeapi/getKline/getHttpBOL.do',param,'POST') 
// 3.2获取k线接口备用
export const getHistoryKLine = (param) => ajax(BASE_URL + '/tradeapi/getHistory/getHttpKLine.do',param,'POST')
// 3.3 查询订单的某一个的详情
export const getOneOrder = (param) => ajax(BASE_URL + '/api/order/getOneOrder.do',param,'POST')
// 3.3订单列表(按照币种种类查询最新)
export const getOrderInfo = (param) => ajax(BASE_URL+'/api/order/getOrderInfo.do',param,'POST')
// 3.4 杠杆交易  交易相关的用exchange
//http://192.168.0.155:7005/lever/trade
export const leverTrade = (param) => ajax(BASE_URL+'/exchange/lever/trade',param,"POST")
// 3.4 止盈止损
export const leverUpdate = (param) => ajax(BASE_URL+'/exchange/lever/update',param,"POST")
// @NotNull(message = "leverTradeId is null")
// private String leverTradeId;
// /** 虚拟购买 0 为虚拟购买 1为实盘购买 */
// @NotNull(message = "accountType is null")
// private String accountType;
// 3.5平仓
export const leverClose = (param) => ajax(BASE_URL+'/exchange/lever/close',param,"POST")
// 3.6 期权交易  http://127.0.0.1:7005/option/trade
export const optionTrade = (param) => ajax(BASE_URL+'/exchange/option/trade')